#include <iostream>
using namespace std;

signed main()
{
    string s1,s2;
    getline(cin,s1);
    getline(cin,s2);
    int vis[1000] = {0};
    for(int i=0;i<s2.size();i++)    vis[s2[i]] = 1;
    for(int i=0;i<s1.size();i++)    if(!vis[s1[i]])    cout<<s1[i];
    return 0;
}
